/*
 * @Author: 专送Pro
 * @Date: 2019-08-23 13:17:18
 * @LastEditors  : wuzhen
 * @LastEditTime : 2020-01-13 10:57:15
 * @Description: 配置文件
 */
/* eslint-disable */
export default {
  data() {
    return {
      // 搜索参数配置
      searchProps: [
        {
          label: "创建时间",
          type: "daterange",
          key: "date",
          placeholder: "请选择创建时间"
        },
        {
          label: "群组类型",
          type: "select",
          key: "grouptype",
          placeholder: "请选择状态",
          options: {
            data: [
              {
                label: "普通",
                value: 10
              },
              {
                label: "匿名",
                value: 20
              }
            ]
          }
        },
        {
          label: "状态",
          type: "select",
          slot: "status"
        }
      ],
      status: "10",
      statusList: [
        {
          label: "正常",
          value: "10"
        },
        {
          label: "已解散",
          value: "80"
        }
      ],
      columns: [
        {
          title: "群组ID",
          key: "groupid",
          width: 120
        },
        {
          title: "群组名称",
          key: "groupname"
        },
        {
          title: "群组公告",
          key: "groupnotice",
          render: (h, params) => {
            const row = params.row;
            return h("span", row.groupnotice || "--");
          }
        },
        {
          title: "群组类型",
          width: 120,
          render: (h, params) => {
            const row = params.row;
            return h(
              "span",
              row.grouptype === 10
                ? "普通"
                : row.grouptype === 20
                ? "匿名"
                : "--"
            );
          }
        },
        {
          title: "群主/群主Id",
          key: "groupnotice",
          width: 250,
          render: (h, params) => {
            const row = params.row;
            return h("span", [
              h("span", row.creator && row.creator.username),
              h(
                "span",
                {
                  class: {
                    warning: true
                  }
                },
                `(${row.createuserid})`
              )
            ]);
          }
        },
        {
          title: "群人数",
          key: "usernum",
          width: 100
        },
        {
          title: "创建时间",
          width: 170,
          render: (h, params) => {
            const row = params.row;
            return h("span", this.$fmtMoment(row.createtime));
          }
        },
        {
          title: "状态",
          width: 140,

          render: (h, params) => {
            const row = params.row;
            return h(
              "Tag",
              {
                props: {
                  color: row.status === 10 ? "success" : "error"
                }
              },
              row.status === 10 ? "正常" : "已解散"
            );
          }
        },
        {
          title: "操作",
          width: 160,
          slot: "action"
        }
      ],
      handleBtn: [
        {
          slot: "action",
          btnType: "action"
        }
      ]
    };
  }
};
